#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>

using namespace std;
int main()
{
    int n, k, distance;
    while (cin >> n)
    {
        vector<int> arr;
        copy_n(istream_iterator<int>(cin), n, back_inserter(arr));
        cin >> k >> distance;
        vector<vector<long long>> arr_max(k), arr_min(k);
        for (auto&& e : arr_max)
            e.resize(n);
        copy(arr.cbegin(), arr.cend(), arr_max[0].begin());
        for (auto&& e : arr_min)
            e.resize(n);
        copy(arr.cbegin(), arr.cend(), arr_min[0].begin());
        vector<long long>& res = arr_max.back();
        for (int ki = 1; ki < k; ki++)
        {
            for (int i = ki; i < n; i++)
            {
                arr_max[ki][i] = numeric_limits<long long>().min();
                arr_min[ki][i] = numeric_limits<long long>().max();
                for (int j = max(i - distance, ki - 1); j < i; j++)
                {
                    if (arr[i] >= 0)
                    {
                        arr_max[ki][i] = max(arr_max[ki - 1][j] * arr[i], arr_max[ki][i]);
                        arr_min[ki][i] = min(arr_min[ki - 1][j] * arr[i], arr_min[ki][i]);
                    }
                    else
                    {
                        arr_max[ki][i] = max(arr_min[ki - 1][j] * arr[i], arr_max[ki][i]);
                        arr_min[ki][i] = min(arr_max[ki - 1][j] * arr[i], arr_min[ki][i]);
                    }

                }
                // res[i]=arr_max[ki][i];
            }
        }
        cout << *max_element(res.cbegin() + (k - 1), res.cend()) << endl;
    }
    return 0;
}
